package com.usian.controller;

import com.usian.service.TrainService;
import com.usian.vo.ResultResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 陈宇轩
 * @version 1.0
 * @date 2023/8/23 21:13
 */

@RequestMapping("/train")
@RestController
public class TrainController {
    @Autowired
    private TrainService comService;

    @GetMapping("/findAllTrain")
    public ResultResponse findAllTrain(){
        try {
            Integer ss=comService.findAllTrain();
            return ResultResponse.Success(ss);
        }catch (Exception e){
            e.printStackTrace();
            return ResultResponse.Errer();
        }
    }
}
